@extends('backend.template.bootstrap')
@section('content')
<div class="m-b-md">
	<h3 class="m-b-none">小说管理</h3>
</div>
<div class="row">
	<div class="col-lg-12">
		<ul class="breadcrumb">
			<li><a href="{{ url('backend') }}"><i class="fa fa-home"></i> 首页</a></li>
			<li><a href="{{ url('backend/books') }}">小说管理</a></li>
			<li class="active">编辑书籍</li>
		</ul>
	</div>
</div>
@if (Session::has('msg'))
<div class="alert alert-dismissable alert-danger">
	<button type="button" class="close" data-dismiss="alert">×</button>
	<strong>消息提示：</strong> {{ Session::get('msg') }}
</div>
@elseif ($errors->any())
<div class="alert alert-danger" role="alert">
	<button type="button" class="close" data-dismiss="alert">×</button>
	<strong>消息提示：</strong> {{ $errors->first() }}
</div>
@endif
<section class="panel panel-default">
	<header class="panel-heading font-bold">
		编辑书籍
	</header>
	<div class="panel-body">
		{!! Form::model($book, array('method' => 'PATCH', 'route' => array('books.update', $book->id), 'files' => true)) !!}
			<div class="form-group">
				{!! Form::label('name', '小说名称', array('class' => 'control-label')) !!}
				{!! Form::text('name', $book->name, array('class' => 'form-control')) !!}
			</div>
			<div class="form-group">
				{!! Form::label('name_pinyin', '中文拼音', array('class' => 'control-label')) !!}
				{!! Form::text('name_pinyin', $book->name_pinyin, array('class' => 'form-control')) !!}
			</div>
			<div class="form-group">
				{!! Form::label('thumbnail', '小说封面', array('class' => 'control-label')) !!}
				{!! Form::file('thumbnail', array('class' => 'form-control')) !!}
			</div>
			<div class="form-group">
				<img src="{{ $book->thumbnailUrl() }}" height="120">
			</div>
			<div class="form-group">
				{!! Form::label('author', '作者', array('class' => 'control-label')) !!}
				{!! Form::text('author', $book->author, array('class' => 'form-control')) !!}
			</div>
			<div class="form-group">
				{!! Form::label('category_id', '所属分类', array('class' => 'control-label')) !!}
				{!! Form::select('category_id', $categories, $book->category_id, array('class' => 'form-control')) !!}
			</div>
			<div class="form-group">
				{!! Form::label('abstract', '简介', array('class' => 'control-label')) !!}
				{!! Form::textarea('abstract', $book->abstract, array('class' => 'form-control', 'rows' => '3')) !!}
	  		</div>
			<div class="form-group">
				{!! Form::label('href', '地址', array('class' => 'control-label')) !!}
				{!! Form::text('href', $book->href, array('class' => 'form-control')) !!}
			</div>
	  		<div class="form-group">
  				<button type="submit" class="btn btn-primary">
  					立即保存
  				</button>
				<a href="{{ url('backend/books') }}" class="btn btn-default">返回</a>
	  		</div>
		{!! Form::close() !!}
	</div>
</section>
@stop